

@property --color-text-primary {
    syntax: "<color>";
    inherits: false;
    initial-value: #434343;
}


@property --color-button-background {
    syntax: "<color>";
    inherits: false;
    initial-value: #fcfaf200;
}


:root {
    --global-content-min-width: 20rem;
    --global-content-min-height: 30rem;

    --color-theme: #e6dece;
    --color-theme-translucent: rgba(230, 222, 206, 0.5);
    --color-book: rgb(241, 229, 201);
    --color-book-translucent: rgba(241, 229, 201, 0.5);
    --color-paper: rgb(241, 229, 201);
    --color-border: #434343;

    --color-primary: #434343;
    --color-foreground: #434343;
    --color-background: #fcfaf200;

    /* 确保兼容性 */
    --color-text-primary: var(--color-primary);
    --color-text-lighting: #ab3b3a;
    --color-text-shadow: #828282;

    /* 确保兼容性 */
    --color-button-background: var(--color-background);
    --color-button-background-hover: var(--color-text-lighting);

    --font-size-xx-small: 0.5rem;
    --font-size-x-small: 0.75rem;
    --font-size-small: 1rem;
    --font-size-medium: 1.25rem;
    --font-size-large: 1.5rem;
    --font-size-x-large: 2rem;
    --font-size-xx-large: 2.5rem;

    --text-underline-offset: 0.3rem;

    --shadow-primary: 5px 5px 0px -2px var(--color-background), 5px 5px var(--color-foreground);
    --shadow-img: 0 0 1.5px #828282;
}



* {
    /* 禁止拖拽 */
    -webkit-user-drag: none;
    /* 平滑滚动 */
    scroll-behavior: smooth;

    box-sizing: border-box;
    padding: 0px;
    margin: 0px;

    /* 文本设置 */
    font-smooth: auto;
    -webkit-font-smoothing: subpixel-antialiased;
    -moz-osx-font-smoothing: auto;
    font-family: "楷体", "宋体", 'Noto Serif SC', serif;
    /* font-size: var(--font-size-medium); */
    /* color: var(--color-text-primary); */
    border-color: var(--color-primary);
    text-shadow: 0 0 1px var(--color-text-shadow);
    text-overflow: ellipsis;
    text-underline-offset: var(--text-underline-offset);
    overflow-wrap: break-word;

    /* 动画 */
    transition: all 0.2s ease-in-out;
}



/* 为所有没有子元素的标签添加 placeholder 功能 */
[placeholder]:empty::before {
    content: attr(placeholder);
}


/* 滚动条样式 */
::-webkit-scrollbar {
    width: 0.25em;
    height: 0.25em;
}

::-webkit-scrollbar-thumb {
    background-color: var(--color-primary);
    border-radius: 0.05em;
}

::-webkit-scrollbar-thumb:hover {
    cursor: default;
}

::-webkit-scrollbar-track  {
    background-color: var(--color-book);
    box-shadow: var(--shadow-img);
}


html,
body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}


body {
    background-color: var(--color-theme);
}


body {
    box-sizing: border-box;
    /* margin: 1rem; */
    padding: 0.5rem;
    padding-top: 1rem;
    padding-bottom: 0;
    background-color: var(--color-theme);

    display: flex;
    flex-direction: column;
    min-width: var(--global-content-min-width);
    min-height: var(--global-content-min-height);
}
@media (min-width: 25rem) {

    body {
        padding: 1rem;
        padding-bottom: 0;
    }

}





main {
    flex: 1;
}



b,
strong {
    font-family: "宋体", 'Noto Serif SC', serif;
    font-size: calc(0.9em);
}



.copyright {
    word-break: keep-all;
    overflow-wrap: normal;
    text-align: center;
    font-family: 'Noto Serif SC', serif;
    font-size: var(--font-size-small);
    text-indent: 0;
    transition: all 0.3s;
}



::selection {
    color: white;
    text-shadow: 0px 0px 1px var(--color-theme);
    background-color: var(--color-text-lighting);
}




h1 {
    font-size: var(--font-size-xx-large);
}

h2 {
    font-size: var(--font-size-x-large);
}

h3 {
    font-size: var(--font-size-large);
}

h4 {
    font-size: var(--font-size-medium);
}

h5 {
    font-size: var(--font-size-small);
}

h6 {
    font-size: var(--font-size-x-small);
}

hr {
    transition: all 0.1s;
    position: relative;
    width: 95%;
    margin-top: 20px;
    margin-bottom: 10px;
    margin-left: auto;
    margin-right: auto;
    border-style: solid;
    border-width: 0px 0px 1px 0px;
}



img {
    border: 2px solid;
    box-shadow: var(--shadow-img);
    width: 90%;
    max-width: 600px;
    object-fit: contain;
    margin: auto;
}


/* section */
section,
.section {
    margin: auto;
    margin-top: 1em;
    margin-bottom: 1em;
}


section > h2,
section > h3,
section > .section-title,
.section > h2,
.section > h3,
.section > .section-title {
    text-align: left;
    margin-bottom: 0.5em;
}

section > h2::before,
.section > h2::before {
    content: " ";
    border-right: 0.5rem solid var(--color-text-lighting);
    margin-right: 5px;
}
section > h3::before,
.section > h3::before {
    content: " ";
    text-align: left;
    border-right: 6px solid var(--color-text-lighting);
    margin-right: 5px;
}

section > .section-title::before,
.section > .section-title::before {
    content: " ";
    text-align: left;
    border-right: 0.25em solid var(--color-text-lighting);
    margin-right: 5px;
}



p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-break: anywhere;
    font-size: var(--font-size-small);
}


a {
    cursor: pointer;
    color: black;
    /* font-size: var(--font-size-medium); */
    text-decoration: none;
}
a:hover {
    cursor: pointer;
}
a:hover,
a > *:hover {
    color: var(--color-text-lighting);
    text-decoration: underline;
    text-decoration-style: dashed;
    text-underline-offset: 0.3rem;
}



button,
input[type=button],
.button {
    text-decoration: none;
    cursor: pointer;

    background-color: var(--color-button-background);
    border: 2px solid var(--color-primary);
    box-shadow: var(--shadow-primary);

    box-sizing: border-box;
    padding: 5px;
    margin: 10px;

    /* 内容居中 */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}


button:hover,
input[type=button]:hover,
.button:hover {
    text-decoration: none;
    color: white;
    background-color: var(--color-button-background-hover);
    text-shadow: 0px 0px 1px var(--color-theme);
}


input {
    box-sizing: border-box;
    padding: 2px;
    border-color: var(--color-primary);
}
input[type=url]:valid ~ span::after,
input[type=url]:valid ~ .tip::after {
    content: "√";
    color: rgb(0, 255, 0);
}
input[type=url]:invalid ~ span::after,
input[type=url]:invalid ~ .tip::after {
    content: "×";
    color: red;
}


ol,
ul {
    list-style: none;
    box-sizing: border-box;
    padding: 0;
}

li {
    box-sizing: border-box;
    padding: 5px;
}


.center-horizontal {
    position: relative;
    margin-left: 50%;
    transform: translateX(-50%);
}


.hide {
    display: none;
}


/* 基于父元素 */
.center-parent {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%);
}

/* 基于页面 */
.center-screen,
.center-window,
.center-page {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%);
}


.text-align-left {
    text-align: left;
}

.text-align-center {
    text-align: center;
}

.text-align-right {
    text-align: right;
}



.font-medium {
    font-size: var(--font-size-medium);
}

.font-large {
    font-size: var(--font-size-large);
}

.text-align-right {
    text-align: right;
}


.gap-10px {
    gap: 10px;
}

.gap-20px {
    gap: 20px;
}


.gap-30px {
    gap: 30px;
}


.margin-top-20px {
    margin-top: 20px;
}

.margin-top-1em {
    margin-top: 1em;
}

.margin-bottom-20px {
    margin-bottom: 20px;
}

.margin-bottom-1em {
    margin-bottom: 1em;
}

.margin-auto {
    margin: auto;
}


/* flex */
.flex-row {
    display: flex;
    flex-direction: row;
}


.flex-column {
    display: flex;
    flex-direction: column;
}

.flex-nowrap {
    flex-wrap: nowrap;
}
.flex-wrap {
    flex-wrap: wrap;
}

.flex-items-center {
    align-items: center;
}


.flex-content-center {
    justify-content: center;
}

.flex-content-between {
    justify-content: space-between;
}


/* grid */
.grid {
    display: grid;
    grid-template-columns: auto;
    grid-template-rows: auto;
}

.grid.column2 {
    grid-template-columns: 1fr 1fr;
}
.grid.column3 {
    grid-template-columns: 1fr 1fr 1fr;
}
.grid.column4 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}
.grid.column5 {
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
}
.grid.column7 {
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
}

.grid.row1 {
    grid-template-rows: 1fr;
}
.grid.row2 {
    grid-template-rows: 1fr 1fr;
}



.block-spacer {
    clear: both;
    height: 1rem;
    margin-top: 2vh;
}


.panel {
    border: 2px solid var(--color-primary);
    box-shadow: var(--shadow-primary);
    box-sizing: border-box;
    padding: 0.5em;
}
@media (min-width: 40rem) {
    .panel {
        padding: 1em;
    }
}


.border {
    border: 2px solid var(--color-primary);
}

.border.dotted {
    border-style: dotted;
    border-radius: 5px 1px 5px 1px;
}



